/*
 * socketserver.h
 *
 *  Created on: 2012-6-25
 *      Author: epmm
 */

#ifndef SOCKETSERVER_H_
#define SOCKETSERVER_H_
#include "object.h"

class CSocketServer: public CMainframe,CSocketSelect::IOnSocket,CJobBase::IResult
{
	CSocketSelect m_SocketSvr;
	CSocketClient m_CallUnix;

	string m_strLocalUnixPath;

public:
	CSocketServer();
	virtual ~CSocketServer();

DECLARE_DYNCREATE(CSocketServer)

public:
	virtual int InitSys(int argc, char **argv);

	virtual int InitConfig(const char* cfgfile);

	virtual int InitLog();

	virtual int InitDB();

	virtual int InitMsg();

	virtual int InitSocket();

	virtual int process();

	virtual int process(const char* pReqstr, string& Response);
public:
	virtual int OnRecv(const string& strBuffer, const int sock_fd);

	virtual int OnSecv(const string& strBuffer, const int sock_fd);

	virtual int Result(CJobBase* pJob);
};

#endif /* SOCKETSERVER_H_ */
